<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 图片在父元素中留白的问题 */
        /* 1.给父元素加 font-size:0 */
        div{
            margin:50px auto;
            width: 400px;
            border: 1px solid #333;
            background-color: gold;
            /* font-size: 0; */
        }
        /* 2.给图片加 vertical-align:bottom */
        img{
            width: 100%;
            vertical-align: bottom;
        }
    </style>
</head>
<body>
    <div>
        <img src="小米官网/images/banner1.png">
    </div>
</body>
</html>